import {createRouter, createWebHistory} from 'vue-router'

import zhuzj from '../components/zhuzj.vue'
import index from '../components/index.vue'
import mulu from '../components/mulu.vue'
import sanpinglb from '../components/sanpinglb.vue'
import detail from '../components/detail.vue'
import search from '../components/search.vue'
import shopping from '../components/shopping.vue'
import collect from '../components/collect.vue'
import duihuang from '../components/duihuang.vue'

const routes = [
  {
    path: '/',
    name: 'zhuzj',
    component : zhuzj,
    redirect: '/index',
    children:[
      {
        path: '/index',
        name: 'index',
        component : index
      },
      {
        path: '/mulu',
        name: 'mulu',
        component: mulu,
        redirect: '/mulu/clothing_more',
        children:[
          {
            path: '/mulu/:id',
            name: 'sanpinglb',
            component: sanpinglb,
            props:true
          }
        ]
      },
      {
        path: '/detail/:id/:index',
        name: "detail",
        component: detail,
        props:true,
        meta: {
            keepAlive: true
        }
      },
      {
        path: '/search/:searchid',
        name: "search",
        component: search,
        meta: {
            keepAlive: true
        }
      },
      {
        path: '/shopping',
        name: 'shopping',
        component: shopping
      },
      {
        path: '/collect',
        name: 'collect',
        component : collect
      },
      {
        path: '/duihuang/:id',
        name: 'duihuang',
        component : duihuang,
        props:true,
        meta: {
            keepAlive: true
        }
      }
      // {
      //   path: '/dd',
      //   name: 'ddgl',
      //   component : ddgl
      // },
      // {
      //   path: '/xt',
      //   name: 'xtsz',
      //   component : xtsz
      // }
    ]
  }
]
const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router

